package week01;


import week01.pay.Payable;
import week01.pay.Wallet;

public class Customer {
    private String firstName = "张三";
    private String lastName;
    //有一个钱包，  也可以有支付宝账号
    private Payable payable = new Wallet(20); // new ZhifubaoPayment();

    public String getFirstName(){
        return firstName;
    }
    public String getLastName(){
        return lastName;
    }

    /**
     * 支付payment元
     * @param payment
     * @return
     */
    public boolean payTo(float payment){
        return payable.subtractMoney(payment);
    }

    public float getTotalMoney(){
        return payable.getTotalMoney();
    }

    /**
     * 拿到报纸
     */
    public void getPaper() {
        System.out.println(firstName +"拿到报纸");
    }
}
